package com.jsoft.dao.impl;

import com.jsoft.dao.UserDao;
import com.jsoft.entity.User;
import com.jsoft.utils.DAO;

/**
 * @author : yhx
 * @version : 1.0
 * @date : 2023/2/19
 */
public class UserDaoImpl extends DAO<User> implements UserDao {
    @Override
    public int loginUser(String account, String password) throws Exception {
        String sql = "select id from user where account = ? and password = ?";
        return getForValue(sql,account,password);
    }

    @Override
    public String findEnterpriseIdByUserAccount(String account) throws Exception {
        String sql = "SELECT enterprise_id enterpriseId FROM `user` WHERE account = ?";
        return getForValue(sql,account);
    }
}
